package client;

import command.Command;
import command.CommandLireMateriel;
import command.CommandMeasure;
import command.CommandTempo;
import command.CommandTreatment;
import controller.Controller;
import controller.ControllerImpl;

import materiel.Horloge;
import materiel.HorlogeImpl;
import moteur.Moteur;
import moteur.MoteurImpl;

import ihm.Ihm;
import ihm.IhmImpl;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author 27002621
 */
public class Client {
	public static void main(String args[]){
		Horloge horloge=new HorlogeImpl();
		Ihm ihm=new IhmImpl();
		Moteur moteur=new MoteurImpl(124, 4, horloge);
		Controller controller=new ControllerImpl(moteur, ihm);
		Command cmdMeasure=new CommandMeasure(controller);
		Command cmdTempo=new CommandTempo(controller);
		Command cmdTreatment=new CommandTreatment(controller);
		Command cmdLireMateriel=new CommandLireMateriel(ihm.getClavier(), ihm.getMouseWheel(), ihm, controller);
		moteur.setCmdMeasure(cmdMeasure);
		moteur.setCmdTempo(cmdTempo);
		moteur.setCmdTreatment(cmdTreatment);
		moteur.attach(controller);
		horloge.commandPeriodically(cmdLireMateriel, 100);
	}
}